<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    标题: <br/> <input type="text" class="title"> <br/>
    正文: <br/> <textarea style="width: 400px; height: 200px;" class="body"></textarea> <br/>
    链接: <br/> <input type="text" class="url"> <br/><br/>
    用户信息: <br/> <textarea style="width: 400px; height: 200px;" class="user-info"></textarea> <br/><br/>
    <button class="submit">提交</button>
</body>
</html>
<script>
    document.querySelector('.submit').addEventListener('click', function(){
        var title = document.querySelector('.title').value;
        var body = document.querySelector('.body').value;
        var url = document.querySelector('.url').value;
        var userInfo = document.querySelector('.user-info').value;
        fetch('/upload', {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json',
            },
            body: JSON.stringify({
                title,
                body,
                url,
                userInfo
            })
        })
    })
</script>